home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 215 / 215.d81 / t.instant menu < prev    next >
Text File  |  2022-08-26  |  5KB  |  215 lines

  1. u
  2.        I N S T A N T   M E N U
  3.  
  4.          Program by Rick Nash
  5.         Text by Fender Tucker
  6.  
  7.  
  8.     There are a couple of things I
  9. hate to do in BASIC. One is print
  10. instructions on the screen. The other
  11. is create menus for insignificant
  12. subroutines. I sent Rick Nash the
  13. BASIC version of this program via
  14. modem along with a few guidelines for
  15. the idea. INSTANT MENU is what he sent
  16. back -- and I must say I'm impressed.
  17.  
  18.     Thanks to INSTANT MENU, I may
  19. never have to create another menu. You
  20. just SYS to this routine with a few
  21. parameters and a menu is printed for
  22. you. You have total control over text
  23. color, box color, highlight color, and
  24. even whether or not your menus are
  25. double spaced.
  26.  
  27.     As an added bonus, you can use
  28. CRSR/RETURN or just press a key, 1-9.
  29. If your menus have more than nine
  30. items then you'll have to use
  31. CRSR/RETURN to access 10 through xx.
  32.  
  33.  
  34.  [HOW TO USE]
  35.  
  36.     INSTANT MENU is fairly simple to
  37. use. It is assembled in six locations:
  38.  
  39.     $0800  2048 -- page   8
  40.     $2000  8192 -- page  32
  41.     $4000 16384 -- page  64
  42.     $8000 32768 -- page 128
  43.     $C000 49152 -- page 192
  44.     $CC00 52224 -- page 204
  45.  
  46.     You should be able to find a safe
  47. place for the code to reside. You
  48. probably already know how to bload the
  49. program into memory:
  50.  
  51.  SYS57812"i-menu $xxxx",dv,0:
  52.  poke780,0: poke781,0: poke782,page:
  53.  sys65493
  54.  
  55.  
  56. The syntax:
  57.  
  58. SYSaddr,items,x,y,box color,highlight
  59. color,text color, "item", <"list",...>
  60.  
  61.     Here is a breakdown of the
  62. parameters:
  63.  
  64. ITEMS: the number of items that will
  65. be in your menu. When a menu is
  66. created, the current screen will be
  67. saved at $d000-d800. When an item is
  68. selected, the menu will disappear. If
  69. you don't want your screen saved and
  70. you don't want the menu to disappear
  71. when an item is selected, add 64 to
  72. this number.
  73.  
  74. X: Beginning X column (0-39) on the
  75. screen. Naturally you won't begin a
  76. menu at 39.
  77.  
  78. Y: Beginning Y row (0-24) on the
  79. screen. Your beginning row should be
  80. at least 24 minus the number of items
  81. (24-(items)). Make that 24-(items*2)
  82. if your menu will be double spaced.
  83.  
  84. BOX COLOR: This specifies the color of
  85. the box that will be drawn around your
  86. items in the menu. If you want a
  87. DOUBLE-SPACED menu, add 64 to the box
  88. color. If you want NO BOX, add 128 to
  89. the box color.
  90.  
  91. HIGHLIGHT COLOR: This is the color of
  92. the current item on the menu. It can
  93. be a different color from the items in
  94. the rest of the menu if you want it to
  95. be.
  96.  
  97. TEXT COLOR: This will be the color of
  98. the items in the menu when they are
  99. not highlighted.
  100.  
  101. "ITEM",<"LIST",...>: These are the
  102. items in your menu. They should be
  103. within quotes unless they are string
  104. variables.  You can have as many items
  105. as you can fit on a line -- or on your
  106. screen. You can fit more on a line if
  107. you use string variables.
  108.  
  109.     If your menus are going to
  110. overwrite a portion of the screen,
  111. then you might want to fill spaces so
  112. that all items are the same length as
  113. the longest item on the list. This way
  114. nothing will show beneath your menus.
  115.  
  116.     When an item is selected and the
  117. menu returns control to your BASIC
  118. program, you can tell what item was
  119. selected by getting a key from the
  120. keyboard buffer:
  121.  
  122.         GET A$
  123.  
  124.     If item one was selected, then A$
  125. will be "1". If item seven was
  126. selected, A$ will be "7" and so on.
  127.  
  128. NOTE: if your menu has more than nine
  129. items in it then the ASCII values
  130. following 9 will be used instead of
  131. the actual numbers, 10-24. Your BASIC
  132. code should be ready for that. One
  133. easy way is this:
  134.  
  135.          A=ASC(A$)-48
  136.          ON A GOSUB...,...,...,...
  137.  
  138.     But most menus won't have more
  139. than nine items so you probably won't
  140. have to worry about that.
  141.  
  142.     So INSTANT MENU might look like
  143. this in your code:
  144.  
  145. SYSmenu:GETA$:ONVAL(A$)GOTO100,200,300
  146.  
  147.     You can use ON VAL(A$) GOSUB or
  148. GOTO in order to direct your program
  149. flow. For more information on ON
  150. GOSUB, see BEGINNING BASICS in
  151. ZP:Basics in this issue.
  152.  
  153. Note from Jeff:  Since INSTANT MENU
  154. can store and restore a screen, I
  155. think the power of a screen switcher
  156. should be capitalized on, so I added
  157. the ability for you to store and
  158. retrieve up to nine screens under ROM
  159. areas.
  160.  
  161.     The SCREEN STASH command is
  162. simple:
  163.  
  164. SYS 49155,screen
  165.  
  166. For other versions of INSTANT MENU
  167. it's addr+3.
  168.  
  169.     The screen can be 0-8. The
  170. eight screens are completely beneath
  171. ROMs and don't touch areas normally
  172. accessed by BASIC programs. Your
  173. border and background colors are
  174. stored with the screen.
  175.  
  176.     The SCREEN RESTORE command gets
  177. the screen back:
  178.  
  179. SYS 49158,screen
  180.  
  181. For other versions of INSTANT MENU,
  182. it's addr+6.
  183.  
  184.     The screens are stored at:
  185.  
  186. $A000, $A800, $B000, $B800,
  187. $D000, $D800, $E000, $E800, $F000
  188.  
  189.     These are the RAM locations of
  190. screens 0-8 respectively. Naturally
  191. you can use any screen you like in
  192. order to ensure compatibility with
  193. other utilities you may be using.
  194.  
  195.     The possibilities are endless.
  196. Have fun (and profit) with the new
  197. power.
  198.  
  199.  JLJ
  200.  
  201.  
  202.  21st Century Note: Ah HAH! The
  203. beginning of the Toolbox concept. As I
  204. browse through early LOADSTAR
  205. programs, I notice that many use a
  206. bunch of small modules, often put
  207. together by an assembler. The
  208. integration of routines in Toolboxes
  209. has become the trademark of LOADSTAR
  210. programming. And here you can see it
  211. coming together.
  212.  
  213.  DMM
  214.  
  215.  
  216.